using System;

namespace Sfd.Services
{
    public class ProgressChangedEventArgs : EventArgs
    {
        public ProgressChangedEventArgs(long currentBytes, long totalBytes)
        {
            CurrentBytes = currentBytes;
            TotalBytes = totalBytes;
        }
        public long CurrentBytes { get; private set; }
        public long TotalBytes { get; private set; }

        public int? Percent
        {
            get
            {
                if (TotalBytes == 0)
                    return null;

                return (int) Math.Round(100f*CurrentBytes/TotalBytes, 0);
            }
        }
    }
}